import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '订单状态',
    align:"center",
    dataIndex: 'stats'
   },
   {
    title: '用户ID',
    align:"center",
    dataIndex: 'userid'
   },
   {
    title: '旅游拼团ID',
    align:"center",
    dataIndex: 'travelgroupid'
   },
   {
    title: '付款截至时间',
    align:"center",
    dataIndex: 'payexpiretime'
   },
   {
    title: '创建时间',
    align:"center",
    dataIndex: 'createtime'
   },
   {
    title: '是否已签合同',
    align:"center",
    dataIndex: 'signcontract'
   },
   {
    title: '待付款金额，原价',
    align:"center",
    dataIndex: 'originprice'
   },
   {
    title: '减去退款后最终金额',
    align:"center",
    dataIndex: 'finalprice'
   },
   {
    title: '上车地',
    align:"center",
    dataIndex: 'startpoint'
   },
   {
    title: '操作历史',
    align:"center",
    dataIndex: 'ctlhistory'
   },
   {
    title: '其余信息',
    align:"center",
    dataIndex: 'extinfor'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '订单状态',
    field: 'stats',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入订单状态!'},
          ];
     },
  },
  {
    label: '用户ID',
    field: 'userid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入用户ID!'},
          ];
     },
  },
  {
    label: '旅游拼团ID',
    field: 'travelgroupid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入旅游拼团ID!'},
          ];
     },
  },
  {
    label: '付款截至时间',
    field: 'payexpiretime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入付款截至时间!'},
          ];
     },
  },
  {
    label: '创建时间',
    field: 'createtime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入创建时间!'},
          ];
     },
  },
  {
    label: '是否已签合同',
    field: 'signcontract',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否已签合同!'},
          ];
     },
  },
  {
    label: '待付款金额，原价',
    field: 'originprice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入待付款金额，原价!'},
          ];
     },
  },
  {
    label: '减去退款后最终金额',
    field: 'finalprice',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入减去退款后最终金额!'},
          ];
     },
  },
  {
    label: '上车地',
    field: 'startpoint',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入上车地!'},
          ];
     },
  },
  {
    label: '操作历史',
    field: 'ctlhistory',
    component: 'InputTextArea',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入操作历史!'},
          ];
     },
  },
  {
    label: '其余信息',
    field: 'extinfor',
    component: 'InputTextArea',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入其余信息!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}